﻿<%@ Page Title="" Language="C#" MasterPageFile="~/App_MasterPages/layout.Master" AutoEventWireup="true" CodeBehind="Gallery.aspx.cs" Inherits="blackhouse.Aparts.Web.Pages.Gallery" %>

<%@ Register Src="~/Modules/ApartmentGallery.ascx" TagName="ApartmentGallery" TagPrefix="blackhouse" %>
<asp:Content ID="Content1" ContentPlaceHolderID="leftContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" runat="server">

    <div class="gray-box-v2 r16to12 a-v4-ins gray-v2">
        <asp:Repeater runat="server" ID="rptApartments" OnItemDataBound="rptApartments_ItemDataBound">
            <ItemTemplate>
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="Apartments.aspx">
            <h2 class="tit-v4 box-title t-uc">Galeria zdjęć <%#Eval("Name") %></h2></asp:HyperLink>
                <blackhouse:ApartmentGallery runat="server" ID="gallery" />
            </ItemTemplate>
        </asp:Repeater>
    </div>

    <asp:Panel runat="server" ID="pnlTryRedirect" Visible="false">
        <script language="javascript" type="text/ecmascript">
            window.location.replace("/pages/gallery.aspx?display=dynamic");
        </script>
    </asp:Panel>

    <style type="text/css">
        .dynamic-gallery {
            position: relative;
        }
        .dynamic-gallery-counter-wrap {
            position:absolute;
            top:0px;
            right:0px;
            background:rgba(0,0,0,0.5);
            padding:6px 15px;
            color:#fff;
        }
        .dyngal-next, .dyngal-prev {
            position:absolute;
            top:50%;
        }
        .dyngal-prev {
            left:1%;
        }
        .dyngal-next {
            right: 1%;
        }
    </style>
    <script language="javascript" type="text/javascript">
        $(function () {
            SetApartmentGallery(ApartmentGallery[0]);
        });

        function SetApartmentGallery(gallery) {
            var $panel = $(gallery.PanelSelector);
            var $img = $('<img />').load(function () {
                $panel.append($(this));
                $panel.width($panel.width());
                $panel.height($panel.height());
            }).attr('src', gallery.Images[0].DisplayUrl);
        }

</script>

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="rightContent" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="pageEditContent" runat="server">
</asp:Content>
